﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QiHe
{
    public partial class Log_Item_List : Form
    {
        DataSet HSPEGNList;
        DataSet EQ_Log_Item;
        string TaskFlag;
        public Log_Item_List(string logFlag)
        {
            InitializeComponent();
            TaskFlag = logFlag;

            DBS db = new DBS();
            HSPEGNList = db.EGN_List();

            comboBox1.DataSource = HSPEGNList.Tables[0];
            comboBox1.DisplayMember = "ChineseName";
            comboBox1.ValueMember = "ID";
            this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;










            EQ_Log_Item = db.Task_Log_List(logFlag);

            dataGridView1.DataSource = EQ_Log_Item.Tables[0];



        }

        private void add_Click(object sender, EventArgs e)
        {
            DBS db = new DBS();

       
            db.Add_Task_Log(TaskFlag,textBox1.Text.ToString(), comboBox1.Text.ToString());


            textBox1.Text = "";

            EQ_Log_Item = db.Task_Log_List(TaskFlag);

            dataGridView1.DataSource = EQ_Log_Item.Tables[0];
        
        
        
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }
    }
}
